package com.xjoyt.pay.merchant.register.controllers;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xjoyt.pay.controllers.AbstractController;
import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.merchant.register.interfaces.MerchantContract;
import com.xjoyt.pay.merchant.register.params.MerchantPageParam;
import com.xjoyt.pay.merchant.register.po.Merchant;
import com.xjoyt.pay.merchant.register.services.MerchantService;

@RestController
@RequestMapping("merchant")
public class MerchantController {

	@Autowired
	private MerchantService service;

	/*@Override
	public PageResult<Merchant> loadPage(@RequestBody PageParam<MerchantPageParam> param) {
		return service.loadPage(param);
	}*/

	@RequestMapping("findAll")
	public List<Merchant> findAll() {
		return service.findAll();
	}
	@RequestMapping("check")
	public ExecuteResult<?> check(String id) {
		
		return service.check(id);
	}
	
	@RequestMapping("register")
	public ExecuteResult<?> register(@RequestBody Merchant param) {
		return service.register(param);
	}
	
	@RequestMapping("update")
	public ExecuteResult<?> update(@RequestBody Merchant param) {
		return service.update(param);
	}
	
	@RequestMapping("findOne")
	public Merchant findOne(String id) {
		
		return service.findOne(id);
	}
	
}
